#include <bits/stdc++.h>
using namespace std;
long long f[1000001][4];
const int M = 1000000007;
int main() {
  int n;
  cin >> n;
  if (n == 1) {
    cout << 1;
    return 0;
  }
  f[2][0] = f[2][1] = f[2][2] = f[2][3] = 1;
  for (int i = 2; i < n; i++) {
    f[i + 1][0] = f[i][1];
    f[i + 1][1] = (f[i][2] + f[i][3]) % M;
    f[i + 1][2] = (f[i][0] + f[i][1]) % M;
    f[i + 1][3] = f[i][2];
  }
  cout << (f[n][0] + f[n][1] + f[n][2] + f[n][3]) % M;
  return 0;
}